<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        body,ul,li,a{
            margin: 0;
            padding: 0;
        }
        ul{
            list-style-type: none;
            width: 750px;
            height: 40px;
            border: 1px solid #ccc;
            margin: 100px auto;
        }
        ul li{
            float: left;
            width: 150px;
            height: 40px;
            text-align: center;
            line-height: 40px;
        }
        ul li a{
            text-decoration: none;
            color: #333;
            display: block;
        }
        ul li.active{
            background: red;
        }
    </style>
</head>
<body>
<ul>
    <li class="active"><a  href="#">首页</a></li>
    <li><a href="#">首页</a></li>
    <li><a href="#">首页</a></li>
    <li><a href="#">首页</a></li>
    <li><a href="#">首页</a></li>
</ul>
</body>
</html>
<script src="js/jquery-1.11.1.min.js"></script>
<script src="js/jquery-1.11.1.min.js"></script>
<script>
    $(function () {
        $("ul li").click(function () {
            $(this).addClass("active").siblings().removeClass("active");
        })
    })
</script>